import axios, { ResponseData } from './index'
import { AxiosPromise } from 'axios'

// 查询所有设备的snmp团体字信息
export const snmpDeviceList = ({ }): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/snmpDeviceList',
        method: 'GET'
    })
}

//ping测试可达性
interface getPingParams {
    seg: string,
}
export const getPing = (params: getPingParams): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/discovery/ping',
        params,
        method: 'GET'
    })
}
//snmp测试可达性-网段团体字破解
interface getSnmpParams {
    communitylist: string,
    seg: string,
}
export const getSnmp = (params: getSnmpParams): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/discovery/snmp',
        params,
        method: 'GET'
    })
}
//node插入/更新数据库
export const putNodeInsert = (data:{}): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/node/insert',
        data,
        method: 'PUT'
    })
}
//添加设备-团体字插入数据库
export const putInsertSnmp = (data:{}): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/snmp/insert',
        data,
        method: 'PUT'
    })
}
//设备管理-新建-密码插入数据库
export const putPasswdInsert = (data:{}): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/passwd/insert',
        data,
        method: 'PUT'
    })
}
// 查询分类树-发现结果页、设备管理页-左侧树形分类
export const getClassThree = (params:{}): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/class/tree',
        params,
        method: 'GET'
    })
}
// 查询最底层分类-发现设备结果页、设备管理页-表格里的分类
export const getClassLeaf = (params:{}): AxiosPromise<ResponseData> => {
    return axios.request({
        url: '/wlpz/class/leaf',
        params,
        method: 'GET'
    })
}